<?php
//信息分类控制器
namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Requests;


class CheckController extends CommonController
{
    
    public function show($id)
    {
       $list = \DB::table("classone")->where("id",$id)->value("pid");
	   //处理信息
        foreach($list as &$v){
            $m = substr_count($v->pidstr,","); //获取path中的逗号
            //生成缩进
            $v->name = str_repeat("&nbsp;",($m-1)*8)."|--".$v->name;
        }
	   $data = \DB::table("classone")->where('id',$id)->first();
	   return view("admin.type.edit",['list'=>$list,'data'=>$data]);
    }

}
